class Solution(object):
    def getRow(self, numRows):
        numRows+=1
        ans=[[1],[1,1]]
        if numRows==1:
            return [1]
        if numRows==2:
            return [1,1]
        for i in range(3,numRows+1):
            i-=2
            arr=[]
            last=ans[len(ans)-1]
            for j in range(i):
                arr.append(last[j]+last[j+1])
            arr=[1]+arr+[1]
            ans.append(arr)
        return ans[len(ans)-1]